// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.async.rest.actuator

import com.metest.api.TestServerExtension
import com.metest.api.client.okhttp.MetestOkHttpClientAsync
import com.metest.api.models.rest.actuator.caches.CachDeleteByNameParams
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
internal class CachServiceAsyncTest {

    @Disabled("Prism tests are disabled")
    @Test
    fun list() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachServiceAsync = client.rest().actuator().caches()

        val cachesFuture = cachServiceAsync.list()

        val caches = cachesFuture.get()
        caches.validate()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun clear() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachServiceAsync = client.rest().actuator().caches()

        val future = cachServiceAsync.clear()

        val response = future.get()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun deleteByName() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachServiceAsync = client.rest().actuator().caches()

        val future =
            cachServiceAsync.deleteByName(
                CachDeleteByNameParams.builder().cache("cache").cacheManager("cacheManager").build()
            )

        val response = future.get()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun retrieveByName() {
        val client =
            MetestOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachServiceAsync = client.rest().actuator().caches()

        val responseFuture =
            cachServiceAsync.retrieveByName(
                CachRetrieveByNameParams.builder()
                    .cache("cache")
                    .cacheManager("cacheManager")
                    .build()
            )

        val response = responseFuture.get()
        response.validate()
    }
}
